public class Animal2 {
    private String name;
    private int age;
    private AnimalTypeEnum type;
    public Animal2(String name,int age,AnimalTypeEnum type){
        this.name=name;
        this.age=age;
        this.type=type;
    }
    public void setName(String name){
        this.name=name;
    }
    public String getName(){
        return name;
    }
    public void setAge(int age){
        this.age=age;
    }
    public int getAge(){
        return age;
    }
    public void setType(AnimalTypeEnum type){
        this.type=type;
    }
    public AnimalTypeEnum getType(){
        return type;
    }
    public boolean equals(Object object){
        if(this==object){
            return true;
        }if(!(object instanceof Animal2)){
            return false;
        }
        Animal2 animal2=(Animal2) object;
        return this.name.equals(animal2.name)&&this.age==animal2.getAge()&&this.type.equals(animal2.getType());
    }
}
